package com.guarantee.server.common.base;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Author huisonglin
 * @Description
 * @PackageName guarantee-server
 * @Package com.guarantee.server.common.base
 * @Date 2022/9/23 16:19
 * @Version 1.0
 */
public interface BaseService<M extends BaseMapper<T>, T> {

    T selectById(Serializable var1);

    Integer insert(T t);

    Integer deleteById(Serializable var1);

    Integer updateById(T t);

    T selectOne(@Param("ew") Wrapper<T> queryWrapper);

    int deleteBatchIds(@Param("coll") Collection<?> idList);

    boolean exists(Wrapper<T> queryWrapper);

    List<T> selectList(@Param("ew") Wrapper<T> queryWrapper);

    int update(@Param("et") T entity, @Param("ew") Wrapper<T> updateWrapper);
}
